<?php

namespace frontend\modules\yii2\controllers;


/**
 * Default controller for the `yii2` module
 */
class DocsController extends IController
{
    public $layout = 'main-yii';

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex()
    {
        return $this->render('index');
    }

    public function actionOverview()
    {
        return $this->render('index');
    }

    public function actionInstall()
    {
        return $this->render('install');
    }
    public function actionInstallDocker()
    {
        return $this->render('install-docker');
    }

    public function actionInstallSource()
    {
        return $this->render('install-source');
    }

    public function actionInstallYiisoft()
    {
        return $this->render('install-yiisoft');
    }

    public function actionInstallCustom()
    {
        return $this->render('install-custom');
    }

    public function actionLayout()
    {
        return $this->render('layout');
    }

    public function actionLife()
    {
        return $this->render('life');
    }

    public function actionStructure()
    {
        return $this->render('structure');
    }

    public function actionStructureModel()
    {
        return $this->render('structure-model');
    }
    public function actionStructureController()
    {
        return $this->render('structure-controller');
    }
    public function actionStructureView()
    {
        return $this->render('structure-view');
    }

    /**
     * 一层目录路由：http://127.0.0.1/docs/structure
     * @param $level1 : structure
     * @return string
     */
    public function actionLevel1($level1){
        return $this->render($level1);
    }

    /**
     * 两层目录路由：http://127.0.0.1/docs/structure/controller
     * @param $level1 : structure
     * @param $level2 : controller
     * @return string
     */
    public function actionLevel2($level1, $level2){
        return $this->render($level1 . "-" . $level2);
    }

    /**
     * 三层目录路由：http://127.0.0.1/docs/structure/controller/web
     * @param $level1 : structure
     * @param $level2 : controller
     * @param $level3 : web
     * @return string
     */
    public function actionLevel3($level1, $level2, $level3){
        return $this->render($level1 . "-" . $level2 . "-" . $level3);
    }
}
